package org.fatewa.engine.exception;

import org.fatewa.engine.advice.exception.RayquazaException;
import org.fatewa.engine.advice.protocol.RayquazaResponse;
import org.fatewa.engine.design.advice.AbstractExceptionProcessor;

/**
 * Rayquaza 框架的默认异常处理
 *
 * @author fatewa
 */
public class RayquazaProcessor extends AbstractExceptionProcessor<RayquazaException> {
    @Override
    public RayquazaResponse map(RayquazaException e) {
        RayquazaResponse response = new RayquazaResponse();
        return response
                .msg(e.msg())
                .code(e.status());
    }
}
